package student.aistar.day13;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class ReaderHelloDemo {
    public static void main(String[] args) throws Exception {
        //1. 确定流
        //2. 确定源头
        //3. 循环读取
        //4. 关闭流 - 可以采取语法糖 - JVM去自行关闭

        //demo - 用来读取文本文件, 然后将内容输出到控制台上去
        BufferedReader in = new BufferedReader(new FileReader("src/student/aistar/day13/Book.java"));

        //一行一行进行读取
        String len = null;
        while(true){
            len = in.readLine(); //读取一整行的数据, 若读取不到, 则返回false
            if(len == null)
                break;
            System.out.println(len);

        }
        in.close();
    }
}
